<template>
  <div class="app-root" :class="{ 'dark-theme': themeStore.isDarkTheme }">
    <nav-header />
    <main class="main-container">
      <router-view />
    </main>
  </div>
</template>

<script setup>
import NavHeader from '@/components/layout/NavHeader.vue'
import { useThemeStore } from '@/stores/theme'

const themeStore = useThemeStore()
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  overflow-x: hidden;
}

#app {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  font-weight: normal;
}

.app-root {
  width: 100vw;
  min-height: 100vh;
  background: var(--bg-color, #f5f7fa);
  color: var(--text-color);
  position: relative;
  padding-top: 64px;
}

.main-container {
  width: 100%;
  min-height: calc(100vh - 64px);
  background: transparent;
}

/* 美化滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, rgba(0, 0, 0, 0.1));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover, rgba(0, 0, 0, 0.2));
}

/* 全局卡片样式 */
:deep(.ant-card) {
  border-radius: 8px;
  transition: all 0.3s;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.05));
  
  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }
  
  .ant-card-head {
    border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.05));
  }
}

/* 全局列表样式 */
:deep(.ant-list-item) {
  transition: all 0.3s;
  border-radius: 6px;
  padding: 12px;
  
  &:hover {
    background: var(--hover-bg, rgba(0, 0, 0, 0.02));
  }
}

/* 全局链接样式 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s;
  
  &:hover {
    color: var(--primary-color-hover);
  }
}
</style>
